package mobi.greenplate.theweb.converter;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import mobi.greenplate.theweb.domain.Transport;
//for : enum types (and many-to-one)

import mobi.greenplate.theweb.domain.TransportType;    


@XmlRootElement(name = "transport")
public class TransportConverter {
    private final Transport entity;

    public TransportConverter() {
        this.entity = new Transport();
    }

    public TransportConverter(Transport entity) {
        this.entity = entity;
    }
    
    @XmlTransient
    public Transport getEntity(){
        return entity;
    }

    @XmlElement
    public Long getId() {
        return entity.getId();
    }

    public void setId(Long id) {
        entity.setId(id);
    }
    
    @XmlElement
    public String getTransportName() {
        return entity.getTransportName();
    }
    
    public void setTransportName(String transportName) {
        entity.setTransportName(transportName);
    }
    @XmlElement
    public String getTransportDescription() {
        return entity.getTransportDescription();
    }
    
    public void setTransportDescription(String transportDescription) {
        entity.setTransportDescription(transportDescription);
    }
    @XmlElement
    public TransportType getType() {
        return entity.getType();
    }
    
    public void setType(TransportType type) {
        entity.setType(type);
    }

    @XmlElement
    public UserConverter getOwner() {
        return new UserConverter(entity.getOwner());
    }

    public void setOwner(UserConverter userConverter) {
        entity.setOwner(userConverter.getEntity());
    }


   
}

